package com.dao;

import com.core.model.user.Administrator;
import com.core.model.user.User;
import org.springframework.cache.annotation.CacheEvict;
import org.springframework.cache.annotation.CachePut;
import org.springframework.cache.annotation.Cacheable;

import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * User: xianfei
 * Date: 2016-01-08
 * Time: 11:15
 * To change this template use Editor | File and Code Templates.
 */
public interface AdminDao extends EntityDao {

    List<User> findAllAdminUser(String currentPage);

    //@CachePut(value = "admin", key = "#a0.getUsername()")
    Administrator saveOrUpdateAdmin(Administrator administrator);  //能保存，但redis里面没数据，可删除

    //@Cacheable(value = "admin", key = "#a0")
    Administrator findAdminByUsername(String username);   //能保存，有数据，但是guid每次不一样

    //@CacheEvict(value = "admin", key = "#p0.getUsername()")
    void deleteAdmin(Administrator administrator);
}
